
using System;
using System.Text;

using NHibernate;
using NHibernate.Cfg;
using NHibernate.Criterion;
using NHibernate.Exceptions;

using LastFMGenNHibernate.EN.LastFM;
using LastFMGenNHibernate.CAD.LastFM;

namespace LastFMGenNHibernate.CEN.LastFM
{
        public partial class ArtistaCEN
        {
        public bool AgregarEtiqueta (int p_Artista_OID, String p_etiqueta)
        {
            ArtistaEN artista = _IArtistaCAD.ReadOIDDefault(p_Artista_OID);
            
                /*PROTECTED REGION ID(LastFM.ArtistaCEN_AgregarEtiqueta_precondition) START*/
            if (p_etiqueta == "")
            {
                throw new ModelException("La etiqueta no puede estar vacia");
            }
                // Preconditions
                // if( !() )
                //              throw new ModelException("Method AgregarEtiqueta() preconditions are violated.");

                /*PROTECTED REGION END*/

                /*PROTECTED REGION ID(LastFM.ArtistaCEN_AgregarEtiqueta_body) ENABLED START*/

                // Body

            Modify(p_Artista_OID, p_etiqueta, artista.Nombre, artista.Valor);

               // throw new NotImplementedException ("Method AgregarEtiqueta() not yet implemented.");

                /*PROTECTED REGION END*/

                /*PROTECTED REGION ID(LastFM.ArtistaCEN_AgregarEtiqueta_postcondition) START*/

                // Postconditions
                // if( !() )
                //              throw new ModelException("Method AgregarEtiqueta() postconditions are violated.");

                /*PROTECTED REGION END*/
            return true;
        }
        }
}
